<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>background-size</title>
    <style type="text/css">
        div{
            margin-top: 10px;
        }
        .green{
            color: green;
        }
        #box1{
            width: 100px;
            height: 200px;
            background: url("img/tx.jpg") no-repeat;
            background-size: 150px;
        }
        #box2{
            width: 100px;
            height: 200px;
            background: url("img/tx.jpg") no-repeat;
            background-size: cover;
        }
        #box3{
            width: 100px;
            height: 200px;
            background: url("img/tx.jpg") no-repeat;
            background-size: contain;
        }
    </style>
</head>
<body>
<form action="#" method="post">
    <fieldset>
    <legend>background-size</legend>
        <div>
            <p class="green">像素</p>
            <p id="box1"></p>
        </div>
        <div>
            <p class="green">cover</p>
            <p id="box2"></p>
        </div>
        <div>
            <p class="green">contain</p>
            <p id="box3"></p>
        </div>
    </fieldset>
</form>

</body>
</html>